<?php
class authorization
{
  var $id_session = '';
  var $result = '';
  
  function authorization()
  {
    include('../data/data.php');
    if ( isset( $_COOKIE['id_session'] ) )
    {
      $this -> id_session = $_COOKIE['id_session'];
      $this -> run();
    }
  }
  
  function run()
  {
    $sql = 'SELECT * FROM session WHERE id_session = \''.$this -> id_session.'\'';
    $this -> result = mysql_query($sql) or die('нет выборки');
    if ( mysql_num_rows($this -> result) > 0 )
    {
      print('<script type="text/javascript" src="js/base.js"></script>');
    }
  }
}

$obj = new authorization();
?>